import 'package:flutter_deer/database/beans/get_user_info_entity.dart';
import 'package:flutter_deer/database/beans/pay/create_order_entity.dart';


class PostCreateQrCode {
  String? groupMchCode = GetUserInfoEntity.get()?.groupMerchantCode ?? '';
  String? mchCode = GetUserInfoEntity.get()?.loginMerchantCode ?? '';
  String? linkType = 'posPlaceOrder';
  bool perpetual = true;
  String? platformType = GetUserInfoEntity.get()?.productClientType;
  String? url = 'subPages/stations/placeOrder/posPlaceOrder';
  String? extFields = '';

  // tojson
  Map<String, dynamic> toJson() {
    return {
      'groupMchCode': groupMchCode,
      'mchCode': mchCode,
      'linkType': linkType,
      'perpetual': perpetual,
      'platformType': platformType,
      'url': url,
      'extFields': extFields,
    };
  }
}

class QrCodeJsonData {
  // var mchGoodsId = ""
  // var goodsShortName = ""
  // var price = ""
  // var shelfId = ""
  // var categoryId = ""
  // var shelfNo = ""
  // var shelfName = ""
  // var unitName = ""
  // var mchCode = ""
  // var goodsAmount = ""
  // var mobilePayId = ""
  //
  // //员工绩效
  // var mchUserId = ""
  // var mchUserName = ""
  //
  // //油单id
  // var energyOrderIds: List<String>? = null
  //
  // //便利店商品
  // var storeGoodsInfos: List<StoreGoodsInfo>? = null
  //
  // val advanceOrder: Int = 0       //是否预付单 0：否  1：是

  String? mchGoodsId = "";
  String? goodsShortName = "";
  String? price = "";
  String? shelfId = "";
  String? categoryId = "";
  String? shelfNo = "";
  String? shelfName = "";
  String? unitName = "";
  String? mchCode = GetUserInfoEntity.get()?.loginMerchantCode ?? '';
  String? goodsAmount = "";
  String? mobilePayId = "";

  //员工绩效
  String? mchUserId = "";
  String? mchUserName = "";

  //油单id
  List<String>? energyOrderIds = [];

  //便利店商品
  List<StoreGoodsInfos>? storeGoodsInfos = [];

  //是否预付单 0：否  1：是
  int advanceOrder = 0; //是否预付单 0：否  1：是

  //tojson
  Map<String, dynamic> toJson() {
    return {
      'mchGoodsId': mchGoodsId,
      'goodsShortName': goodsShortName,
      'price': price,
      'shelfId': shelfId,
      'categoryId': categoryId,
      'shelfNo': shelfNo,
      'shelfName': shelfName,
      'unitName': unitName,
      'mchCode': mchCode,
      'goodsAmount': goodsAmount,
      'mobilePayId': mobilePayId,
      'mchUserId': mchUserId,
      'mchUserName': mchUserName,
      'energyOrderIds': energyOrderIds,
      'storeGoodsInfos': storeGoodsInfos?.map((e) => e.toJson()).toList(),
      'advanceOrder': advanceOrder,
    };
  }
}
